package com.cgydu.controller;

import com.cgydu.annotation.ContentType;
import com.cgydu.entity.Message;
import com.cgydu.service.impl.TypeServiceImpl;
import jdk.nashorn.internal.objects.annotations.Constructor;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.SQLException;

/**
 * projectName: day25_store
 * author: CGY
 * time: 2020/8/27 16:44
 * description:
 */
@WebServlet("/type")
public class TypeController extends BaseController{

    @ContentType("application/json;charset=utf-8")
    public Message getTypes(HttpServletRequest request, HttpServletResponse response) throws SQLException {
        //1.获取请求参数
        //2调用业务逻辑
        TypeServiceImpl typeService = new TypeServiceImpl();
        Message message = typeService.findTypes();

        //3.响应

        return  message;
    }
}
